//
//  UserGuideViewController.m
//  豆瓣终极版
//
//  Created by dllo on 15/12/21.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "UserGuideViewController.h"
#import "ActivetyViewController.h"

@interface UserGuideViewController ()

@end

@implementation UserGuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self initGuide];
}

- (void)initGuide{
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
    scrollView.contentSize = CGSizeMake(375 * 2, 667);
    [scrollView setPagingEnabled:YES];
    scrollView.bounces = NO;
    [self.view addSubview:scrollView];
    [scrollView release];
    
    UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 375, 667)];
    imageView1.image = [UIImage imageNamed:@"image1.jpg"];
    [scrollView addSubview:imageView1];
    [imageView1 release];
    
    UIImageView *imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(375, 0, 375, 667)];
    imageView2.image = [UIImage imageNamed:@"image2.jpg"];
    [scrollView addSubview:imageView2];
    [imageView2 release];
    imageView2.userInteractionEnabled = YES;
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake((375 - 100) / 2, 500, 100, 40)];
    button.titleLabel.text = @"进入";
    button.backgroundColor = [UIColor redColor];
    [button addTarget:imageView2 action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    [imageView2 addSubview:button];
    NSLog(@"*******");

    
}

- (void)buttonAction:(UIButton *)btn{
    NSLog(@"--------");
    ActivetyViewController *actVC = [[ActivetyViewController alloc] init];
    [actVC.view sendSubviewToBack:self.view];
    
    
        
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
